<script setup lang="ts">


import {useRoute} from "vue-router";
import {toRefs} from "vue";

const route = useRoute() //这个就是一个hook函数 useXXX是hook明明规范

let { query } =toRefs(route)  //从一个对象结果出来,会变成不是响应式对象


</script>

<template>
<ul>
  <li>id: {{ query.id }}</li>
  <li>名字:  {{ query.name }}</li>
</ul>
</template>

<style scoped>

</style>